This method calculates the Percentage Price Oscillator.
var PPO(fastPeriod, slowPeriod, maType, dataArray, calculatedDataArray);
fastPeriod
Fast period integer value.
slowPeriod
Slow period integer value.
maType
One of the Moving Average constants, defined here.
dataArray
Array object filled with any data which will be used as the source for calculation.
calculatedDataArray
Empty Array object that will be filled with calculated data.
Returns true if calculation was completed successfully, or false otherwise.
The following example demonstrates how to use PPO method.
function calculate(beginIndex, endIndex)
{
var fastPeriod = 15;
var slowPeriod = 5;
var maType = TechnicalAnalysis.MA_EMA;
var dataArray = new Array();
//populate data array...
...
var calculatedDataArray = new Array();
var rc = TechnicalAnalysis.PPO(fastPeriod, slowPeriod, maType, dataArray, calculatedDataArray);
}
Copyright © 2006-2009 ActiveTick LLC